﻿using System;
using System.Collections.Generic;
using System.Text;
using NBusiness.Data;

namespace NBusiness.Data.Rules
{
    [Serializable]
    public class AccessRule : IAccessRule
    {
        private Type _type;
        private string _field;
        private bool _allow;
        private string _role;
        private AccessRuleType _ruleType;

        public Type Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public string Field
        {
            get { return _field; }
        }            

        public bool Allow
        {
            get { return _allow; }
        }            

        public string Role
        {
            get { return _role; }
        }            

        public AccessRuleType RuleType
        {
            get { return _ruleType; }
        }

        public AccessRule(Type type, string field, AccessRuleType ruleType, string role, bool allow)
        {
            _type = type;
            _field = field;
            _ruleType = ruleType;
            _allow = allow;
            _role = role;
        }
    }
}
